import { Entity, Column, BaseEntity, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
export enum SmsCodeTypeEnum {
    USER = 0,//用户
    CREDITER = 1,//信贷经理
}
export enum SmsCodeStatusEnum {
    ENABLE = 1,
    DISABLE = 0,//无效
}
//用户手机发送短信验证码记录
@Entity('mobile_sms')
// export class MobileSms {
export class MobileSms extends BaseEntity {

    @PrimaryGeneratedColumn()
    id: number;

    @Column({
        width: 11,
        comment: "手机号"
    })
    mobile: string;

    @Column({
        length: 10,
        comment: "短信验证码"
    })
    code: string;

    @Column({
        width: 5,
        default: SmsCodeStatusEnum.ENABLE,
        comment: "状态，0无效，1有效"
    })
    status: number;

    @Column({
        width: 5,
        default: SmsCodeTypeEnum.USER,
        comment: "类型，0是用户端，1是信贷经理端"
    })
    type: number;

    @CreateDateColumn({
        comment: "创建时间",
    })
    create_time: Date;

    @Column({
        comment: "过期时间"
    })
    expire_time: Date;

    @UpdateDateColumn({
        comment: "更新时间"
    })
    update_time: Date;

}